// #region 继承
class Person{
    // public name:string;
    //修饰符没写默认public
    // age:number;
    //构造函数，简写属性赋值
    constructor(public name:string,public age:number){
        this.name=name;
        this.age=age;
    }

    eat():void{
        console.log(this.name+"在吃饭",this.age,"岁","哈哈哈");
    }
}
class Student extends Person{
    //继承父类Person的属性，并添加额外属性
    score:number;
    constructor(name:string,age:number,score:number){
        super(name,age);
        this.score = score;
    }
    study():void {
        console.log("我正在学习");
    }
    override eat():void {
        console.log(this.name+"我正在吃饭")
    }
}
new Student("小明",18,90).eat();
//#endregion

